package com.bee.rbac.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.bee.admin.sys.model.User;

@RestController
@RequestMapping
public class HelloWorld {

	@RequestMapping("hello")
	public String sayHello(){
        Session session = SecurityUtils.getSubject().getSession();
        User user=(User)session.getAttribute("user");
        
		return user.getUsername();
	}
	
	@RequestMapping("err")
	public String errorHello(){
		return "err";
	}

    @RequestMapping("/")
    public String index() {
        return "no permission";
    }
}
